package com.custom.dao;

import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import javax.sql.DataSource;

/**
 * @author wh
 * @Description
 * @date 2018/4/4 17:44
 */
@Repository("baseDao")
public class DataJDBCTemplate implements BaseDao {
    private DataSource dataSource;
    private JdbcTemplate jdbcTemplate;

    public void setDataSource(DataSource dataSource) {
        this.dataSource = dataSource;
        jdbcTemplate = new JdbcTemplate(dataSource);
    }

    public void update(String sql) {
        jdbcTemplate.update(sql);
    }
}
